import React from 'react'
import './index.css';
import Item from '../item';
export default class List extends React.Component {
    delectItem = (itemId) => {
        this.props.removeItem(itemId)
    }
    checkStatus = (id, status) => {
        this.props.checkItem(id, status);
    }
    render () {
        return (
            <ul>
                {
                    this.props.todoList.map((item) => {
                        return <Item key={item.id} {...item} delectItem={this.delectItem} checkStatus={this.checkStatus} />
                    })
                }

            </ul>
        )
    }
}